package com.dm.cloud.auth.feign.service;

import com.dm.cloud.auth.common.po.AuthApp;
import com.dm.cloud.auth.feign.service.impl.AuthAppServiceImpl;
import com.dm.cloud.core.config.CustomFeignRequestInterceptor;
import com.dm.cloud.core.mode.ResultModel;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(name = "equip-auth-service",
        path = "/equip-auth-service/apis/v1/authApp",
        fallback = AuthAppServiceImpl.class,
        configuration = CustomFeignRequestInterceptor.class
)// 这个留着可以继续用feign
public interface AuthAppService {

    @RequestMapping(path = "findByAppCode",method = RequestMethod.GET)
    @Operation(summary = "获取应用客户端认证信息")
    public ResultModel<AuthApp> findByAppCode(
            @RequestParam(value = "appCode") String appCode
    );
    @GetMapping("appCodeName")
    @Operation(summary = "获取应用code和名称的映射关系Map")
    public ResultModel<Map<String,String>> appCodeName();
}
